<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>组件配置配置</title>
        <link rel="stylesheet" type="text/css" href="/Plug-in/ext/colorpicker/colorpicker.css" />

        <{$showjs}>
        <script type="text/javascript" src="/Plug-in/ext/colorpicker/colorpicker.js"></script>
        <script type="text/javascript" src="/Plug-in/ext/colorpicker/colorpickerfield.js"></script>
        <link rel="stylesheet" type="text/css" href="../css/main1.css" />
        <style>
            .x-check-group-alt {
                background: #D1DDEF;
                border-top:1px dotted #B5B8C8;
                border-bottom:1px dotted #B5B8C8;
            }
        </style>
        <script type="text/javascript">
            Ext.QuickTips.init();
            Ext.form.Field.prototype.msgTarget = 'side';
            Ext.onReady(function(){
                var fp = new Ext.form.FormPanel({
                    frame: true,
                    labelWidth: 110,
                    width: Ext.getBody().getWidth(),
                    renderTo: document.body,				fileUpload: true, 
                    bodyStyle: 'padding:0 10px 0;',
                    laout:'form',
                    items: [{
                            xtype:'fieldset',
                            title: '通用配置',
                            autoHeight: true,
                            items: [{
                                    itemCls: 'x-check-group-alt',
                                    allowBlank: false,
                                    layout:'column',
                                    items: [{
                                            columnWidth: '.33',
                                            bodyStyle: 'padding:0 10px 0;',
                                            labelWidth:60,
                                            layout:'form',
                                            items: [{
                                                    xtype: 'checkboxgroup',
                                                    fieldLabel: '配置',
                                                    itemCls: 'x-check-group-alt',
                                                    items: [
                                                        {boxLabel: '搜索', name: 'gj',inputValue: 1<{if $fld.gj=='1'}>,checked: true<{/if}>},
                                                        {boxLabel: '屏蔽', name: 'xr',inputValue:1<{if $fld.xr=='1'}>,checked: true<{/if}>}
                                                    ]
                                                },{
                                                    xtype: 'checkboxgroup',
                                                    fieldLabel: '打勾配置',
                                                    itemCls: 'x-check-group-alt',
                                                    items: [
                                                        {boxLabel: '缩略1', name: 'cfg[sl1]',inputValue:1<{if $cfg.sl1=='1'}>,checked: true<{/if}>},
                                                        {boxLabel: '缩略2', name: 'cfg[sl2]',inputValue:1<{if $cfg.sl2=='1'}>,checked: true<{/if}>}
                                                    ]
                                                },{
                                                    xtype: 'combo',value:'<{if $cfg.type==''}>1<{else}><{$cfg.type}><{/if}>',fieldLabel:'格式',blankText:'...不能为空',style:'text-align:left',mode: 'local',forceSelection: true,triggerAction: 'all',width: 90,editable: false,emptyText:'请选择...',valueField :'yinv',displayField:'xianv',store:new Ext.data.SimpleStore({fields:['yinv','xianv'],data:[['0','压缩包'],['1','图片'],['2','影音'],['3','文档'],['4','不限']]}),hiddenName: 'cfg[type]'
                                                },{
                                                    xtype: 'checkboxgroup',
                                                    fieldLabel: '上传路径',
                                                    itemCls: 'x-check-group-alt',
                                                    items: [{
                                                            xtype: 'textfield',
                                                            name: 'cfg[sclj]',
                                                            fieldLabel: '',
                                                            hideLabel :true,
                                                            value:'<{$cfg.sclj|default:"pic"}>',
                                                            width:'80px'
                                                        }]
                                                }
                                            ]
                                        },{
                                            columnWidth: '.33',
                                            bodyStyle: 'padding:0 10px 0;',
                                            labelWidth:40,
                                            layout:'form',
                                            items: [{
                                                    html:"<font color='red'><b>缩略图1[ thumb1_ ]<hr></b></font>"
                                                },{
                                                    xtype: 'textfield',
                                                    name: 'cfg[sl1x]',
                                                    fieldLabel: '宽',
                                                    value:'<{$cfg.sl1x}>',
                                                    width:'80px'},
                                                {
                                                    xtype: 'textfield',
                                                    name: 'cfg[sl1y]',
                                                    fieldLabel: '高',
                                                    value:'<{$cfg.sl1y}>',
                                                    width:'80px'}]
                                        },{
                                            columnWidth: '.33',
                                            bodyStyle: 'padding:0 10px 0;',
                                            labelWidth:40,
                                            layout:'form',
                                            items: [{
                                                    html:"<font color='red'><b>缩略图2[ thumb2_ ]<hr></b></font>"
                                                },{
                                                    xtype: 'textfield',
                                                    name: 'cfg[sl2x]',
                                                    fieldLabel: '宽',
                                                    value:'<{$cfg.sl2x}>',
                                                    width:'80px'},
                                                {
                                                    xtype: 'textfield',
                                                    name: 'cfg[sl2y]',
                                                    fieldLabel: '高',
                                                    value:'<{$cfg.sl2y}>',
                                                    width:'80px'}]
                                        }]
                                }]
                        },{
                            xtype:'fieldset',
                            title: '水印配置',
                            autoHeight: true,
                            items: [{
                                    itemCls: 'x-check-group-alt',
                                    allowBlank: false,
                                    layout:'column',
                                    items: [{
                                            columnWidth: '.33',
                                            bodyStyle: 'padding:0 10px 0;',
                                            labelWidth:80,
                                            layout:'form',
                                            items: [{
                                                    xtype: 'checkboxgroup',
                                                    fieldLabel: '打勾配置',
                                                    itemCls: 'x-check-group-alt',
                                                    items: [
                                                        {boxLabel: '图片水印打开', name: 'cfg[sypic]',inputValue:1<{if $cfg.sypic=='1'}>,checked: true<{/if}>}
                                                    ]
                                                },{
                                                    xtype: 'checkboxgroup',
                                                    fieldLabel: '打勾配置',
                                                    itemCls: 'x-check-group-alt',
                                                    items: [
                                                        {boxLabel: '文字水印打开', name: 'cfg[sytxt]',inputValue:1<{if $cfg.sytxt=='1'}>,checked: true<{/if}>}
                                                    ]
                                                },{xtype: 'combo',value:'<{if $cfg.sypicwz==''}>9<{else}><{$cfg.sypicwz}><{/if}>',fieldLabel:'图片水印位置',blankText:'...不能为空',style:'text-align:left',mode: 'local',forceSelection: true,triggerAction: 'all',width: 90,editable: false,emptyText:'请选择...',valueField :'picyinv',displayField:'picxianv',store:new Ext.data.SimpleStore({fields:['picyinv','picxianv'],data:[['0','随机位置'],['1','顶端居左'],['2','顶端居中'],['3','顶端居右'],['4','中部居左'],['5','中部居中'],['6','中部居右'],['7','底端居左'],['8','底端居中'],['9','底端居右']]}),hiddenName: 'cfg[sypicwz]'},{xtype: 'combo',value:'<{if $cfg.sytxtwz==''}>1<{else}><{$cfg.sytxtwz}><{/if}>',fieldLabel:'文字水印位置',blankText:'...不能为空',style:'text-align:left',mode: 'local',forceSelection: true,triggerAction: 'all',width: 90,editable: false,emptyText:'请选择...',valueField :'txtyinv',displayField:'txtxianv',store:new Ext.data.SimpleStore({fields:['txtyinv','txtxianv'],data:[['0','随机位置'],['1','顶端居左'],['2','顶端居中'],['3','顶端居右'],['4','中部居左'],['5','中部居中'],['6','中部居右'],['7','底端居左'],['8','底端居中'],['9','底端居右']]}),hiddenName: 'cfg[sytxtwz]'}]
                                        },{
                                            columnWidth: '.4',
                                            bodyStyle: 'padding:0 10px 0;',
                                            labelWidth:60,
                                            layout:'form',
                                            items: [{
                                                    xtype: 'textfield',
                                                    name: 'sytp',
                                                    fieldLabel: '水印图片',
                                                    value:'',
                                                    inputType:'file',
                                                    width:'110px'},{
                                                    xtype: 'textfield',
                                                    name: 'cfg[sywz]',
                                                    fieldLabel: '水印文字',
                                                    value:'<{$cfg.sywz}>',
                                                    width:'80px'},{xtype: 'combo',value:'<{if $cfg.syzt==''}>wqy-microhei-lite.ttc<{else}><{$cfg.syzt}><{/if}>',fieldLabel:'水印字体',blankText:'...不能为空',style:'text-align:left',mode: 'local',forceSelection: true,triggerAction: 'all',width: 90,editable: false,emptyText:'请选择...',valueField :'ztyinv',displayField:'ztxianv',store:new Ext.data.SimpleStore({fields:['ztyinv','ztxianv'],data:[['wqy-microhei-lite.ttc','wqy-microhei-lite.ttc'],['GRIMACE.TTF','GRIMACE.TTF'],['ariali.ttf','ariali.ttf'],['AndaleMo.TTF','AndaleMo.TTF']]}),hiddenName: 'cfg[syzt]'}, {
                                                    xtype: 'colorpickerfield',
                                                    fieldLabel: '文字颜色',
                                                    name: 'cfg[syys]',
                                                    value: '<{if $cfg.syys==''}>FF0000<{else}><{$cfg.syys}><{/if}>',
                                                    width:'60px'
                                                }]
                                        },{
                                            columnWidth: '.27',
                                            bodyStyle: 'padding:0 10px 0;',
                                            labelWidth:60,
                                            layout:'form',
                                            items: [{
                                                    html:"<font color='red'><b>位置示意<hr></b></font><img width=\"140px\" src=\"../img/sy.jpg\">"
                                                }]
                                        }]
                                }]
                        },{
                            xtype:'fieldset',
                            title: '通用配置',
                            autoHeight: true,
                            items: [{
                                    itemCls: 'x-check-group-alt',
                                    allowBlank: false,
                                    layout:'column',
                                    items: [{
                                            columnWidth: '.4',
                                            bodyStyle: 'padding:0 10px 0;',
                                            labelWidth:100,
                                            layout:'form',
                                            items: [{
                                                    xtype: 'textfield',
                                                    name: 'cfg[size]',
                                                    fieldLabel: '文件大小限制[K]',
                                                    value:'<{if $cfg.size==''}>200<{else}><{$cfg.size}><{/if}>',
                                                    width:'80px'},{
                                                    xtype: 'textfield',
                                                    name: 'cfg[sywzdx]',
                                                    fieldLabel: '水印文字大小[PX]',
                                                    value:'<{if $cfg.sywzdx==''}>12<{else}><{$cfg.sywzdx}><{/if}>',
                                                    width:'80px'},{
                                                    xtype: 'checkboxgroup',
                                                    fieldLabel: '打勾配置',
                                                    itemCls: 'x-check-group-alt',
                                                    items: [
                                                        {boxLabel: '转译打开', name: 'zy',inputValue: 1<{if $fld.zy=='1'}>,checked: true<{/if}>}
                                                    ]
                                                }]
                                        },{
                                            columnWidth: '.3',
                                            bodyStyle: 'padding:0 10px 0;',
                                            labelWidth:40,
                                            layout:'form',
                                            items: [{
                                                    html:"<font color='red'><b>XY坐标<hr></b></font>"
                                                },{
                                                    xtype: 'textfield',
                                                    name: 'x',
                                                    fieldLabel: 'X轴',
                                                    value:'<{$fld.x}>',
                                                    width:'80px'},
                                                {
                                                    xtype: 'textfield',
                                                    name: 'y',
                                                    fieldLabel: 'Y轴',
                                                    value:'<{$fld.y}>',
                                                    width:'80px'}]
                                        },{
                                            columnWidth: '.3',
                                            bodyStyle: 'padding:0 10px 0;',
                                            labelWidth:40,
                                            layout:'form',
                                            items: [{
                                                    html:"<font color='red'><b>Z坐标<hr></b></font>"
                                                },{
                                                    xtype: 'textfield',
                                                    name: 'z',
                                                    fieldLabel: 'Z轴',
                                                    value:'<{$fld.z}>',
                                                    width:'80px'},{
                                                    xtype: 'hidden',
                                                    name: 'id',
                                                    value:'<{$fld.id}>'},{
                                                    xtype: 'hidden',
                                                    name: 'type',
                                                    value:'<{$fld.type}>'}]
                                        }]
                                }]
                        },{
                            xtype: 'textarea',
                            fieldLabel: 'STR[JSON]{,结尾,否则不显示,此处是EXTJS式的JSON配置.}',
                            name:'cfg[STR]',
                            width:200,
                            value:'<{$cfg.STR}>'
                        },{
                            html:"<font color='red'><b>缩略图<hr></b></font><img width=\"140px\" src=\"<{if $cfg.sytp==''}>../img/zwtp.jpg<{else}>../../uplods/<{$cfg.sytp}><{/if}>\">"
                        }],
                    buttons:[{
                            text: '保存',
                            handler: function(){
                                if(fp.getForm().isValid()){
                                    //Ext.Msg.alert('Submitted Values',fp.getForm().getValues(true).replace(/&/g,', '));
                                    fp.form.doAction('submit',{
                                        url:'fldcfg.php',
                                        method:'POST',
                                        params:{op:'save'},
                                        waitMsg:'正在提交....',
                                        success:function (response){
                                            parent.Ext.getCmp('<{$fld.id}>').close();
                                        },
                                        failure:function (response){
                                            Ext.MessageBox.alert('信息提示','提交失败');
                                        }
                                    });

                                }
                            }
                        },{
                            text: 'Reset',
                            handler: function(){
                                fp.getForm().reset();
                            }
                        }]
                });
            });
        </script>

    </head>
    <body>
    </body>
</html>
